#coding=utf-8
from selenium import webdriver
import time, datetime

def login(url,phone,password):
    driver = webdriver.Chrome()
    driver.set_window_size(414,736)
    driver.get(url)
    driver.find_element_by_xpath('//*[@id="app"]/div/form/div[1]/input').send_keys(phone)
    driver.find_element_by_xpath('//*[@id="app"]/div/form/div[2]/input').send_keys(password)
    driver.find_element_by_xpath('//*[@id="app"]/div/button').click()
    time.sleep(2)
    driver.refresh()
    cookies = driver.get_cookies()
    print cookies
    driver.quit()



if __name__ == '__main__':
    login('http://community-ui1-test.gdgyun.com/#/login','17781108472','cq123321')
